<%@ page import="lib4app.AppRemoteConnector" %>
<%@ page import="com.alibaba.fastjson.JSONArray" %>
<%@ page import="com.alibaba.fastjson.JSON" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.LinkedHashMap" %>
<%@ page import="webserver.HTMLMaker" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
 <head>
  <style>
.ON {background-color:green;}
.OFF {background-color:red;}
.beautiful-table table {border-collapse:collapse;}
.beautiful-table th {background-color: #c9c9c9;text-align:left;padding:8px;}
.beautiful-table tr:nth-child(even) {background-color:#f1f3f3;}
.beautiful-table td, .beautiful-table th {border: 1px solid #bbbbbb;padding:4px 8px 4px 8px;}
</style>
 </head>
 <body>
 <h1>资源状态列表</h1>
  <jsp:scriptlet>
   AppRemoteConnector conn = (AppRemoteConnector) application.getAttribute("conn"); HTMLMaker maker = (HTMLMaker) application.getAttribute("maker");
  </jsp:scriptlet>
 <h3>sensor资源</h3>
  <jsp:expression>
   maker.makeTable("{\"sensor_name\":\"Sensor Name\",\"state\":\"State\",\"apps\":\"Registered App\",\"value\":\"Value\"}", conn.raw("{\"api\":\"get_all_sensor_info_and_data\"}"))
  </jsp:expression>
 <h3>actor资源</h3>
  <jsp:expression>
   maker.makeTable("{\"actor_name\":\"Actor Name\",\"state\":\"State\",\"apps\":\"Registered App\"}", conn.raw("{\"api\":\"get_all_actor_info\"}"))
  </jsp:expression>
 </body>
</html>